<!doctype html>
<html lang="en-US">
<head>
<base href="${basePath}"/>
<meta charset="UTF-8">
<title>云支付商户中心</title>
<meta name="keywords" content="云支付商户中心">
<meta name="description" content="云收款，云订单，云支付是重庆创优汇电子商务有限公司推出的一款网络代收款服务。云支付，网络第三方代收货款，即时到账。"> 
<#include "/views/ftl/base/web_header.ftl">
<script type="text/javascript" src="${basePath}js/jquery-1.8.3.min.js" ></script>
</head>
<body>
<#import "/views/ftl/base/web_top.ftl" as r>
<@r.thebean urlname="login"/>

    <div class="main">
        <div class="container user clear">

            <div class="picture slide" id="picture">
                <ul class="slides">
                    <li><img src="images/yp/slide1.png" /></li>
                    
                </ul>
            </div>
            <div class="userForm login">
                <h3>商户登录</h3>
             <div   class="ui-form"> 
                <ul class="clear">
                    <li><label>商户账号</label><input class="inputBox" type="text" name="userName" id="user" value="" placeholder="输入您的商户号码" /></li>
                    <li><label>商户密码</label><input class="inputBox" type="password" name="passWord" id="pass" placeholder="输入您的登录密码"  /></li>
                    <li><label>验证码</label><input class="inputBox" style="width:150px" type="text" name="verifyCode" id="code" placeholder="输入您的验证码"  /><img src="${basePath}shopmanage/ManagerAuth_loginVerifyCode" alt="看不清，请点击刷新" class="imgValidateCode" title="看不清，请点击刷新" onClick="this.src=this.src+'?'" /></li>
                    <li><label class="remember">
                        <input name="chk" type="checkbox" id="chk" checked >记住账户</label> <a id="forgetpass" href="javascript:void(0);">忘记密码?</a></li>

                    <li>
                        <button class="button subButton" type="submit" id="login" name="login">立即登录</button>
                        <a class="button regButton"  href="javascript:void(0);">申请成为商户</a>
                    </li>
                </ul>
              </div> 
            </div>
        </div>
    </div>

<script type="text/javascript">
$(function(){
	$('.imgValidateCode').click(function(){
		changeVerifyCode();
	});
	
	$('input').keyup(function(e) {
		if (e.which == 13) {
			login();
		}
	}); 
	
	
	
	function changeVerifyCode(){ 
		$('.imgValidateCode').attr('src','${basePath}shopmanage/ManagerAuth_loginVerifyCode?m='+Math.random());  
	}
	
	function login(){ 
		var userName = $("input[name=userName]").val(); 
		var verifyCode = $("input[name=verifyCode]").val(); 
		var passWord = $("input[name=passWord]").val();
		if(''==userName){
			alert("用户名不能为空");
			return ;
		}
		if(''==verifyCode){
			alert("用户名不能为空");
			return ;
		}
		if(''==passWord){
			alert("用户名不能为空");
			return ;
		}
		
		
		
		$.ajax({ 
			url : "${basePath}shopmanage/ManagerAuth_login",
			data : { 
				userName : userName, 
				verifyCode :verifyCode,
				passWord : passWord
			}, 
			dataType :"JSON",
			cache : false, 
			type : "POST",
			success : function(dat){
				changeVerifyCode();
				if(dat.code==1){
					window.location.href="${basePath}shopmanage/Index_index";
				}else{
					alert(dat.msg);	
				} 
			}
		});
	}
	

	$("#login").click(function(){
		login();	
	});
	
});
</script>

 <#include "/views/ftl/base/web_footer.ftl">
</body>
</html>